<!-- HTML header for doxygen 1.8.6-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/xhtml;charset=utf-8" http-equiv="Content-Type"/>
<meta content="IE=9" http-equiv="X-UA-Compatible"/>
<meta content="Doxygen 1.8.13" name="generator"/>
<title>OpenCV: cv::BackgroundSubtractorKNN Class Reference</title>
<link href="../../opencv.ico" rel="shortcut icon" type="image/x-icon"/>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script src="../../jquery.js" type="text/javascript"></script>
<script src="../../dynsections.js" type="text/javascript"></script>
<script src="../../tutorial-utils.js" type="text/javascript"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script src="../../search/searchdata.js" type="text/javascript"></script>
<script src="../../search/search.js" type="text/javascript"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
//<![CDATA[
MathJax.Hub.Config(
{
  TeX: {
      Macros: {
          matTT: [ "\\[ \\left|\\begin{array}{ccc} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{array}\\right| \\]", 9],
          fork: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ \\end{array} \\right.", 4],
          forkthree: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ \\end{array} \\right.", 6],
          forkfour: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ #7 & \\mbox{#8}\\\\ \\end{array} \\right.", 8],
          vecthree: ["\\begin{bmatrix} #1\\\\ #2\\\\ #3 \\end{bmatrix}", 3],
          vecthreethree: ["\\begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{bmatrix}", 9],
          cameramatrix: ["#1 = \\begin{bmatrix} f_x & 0 & c_x\\\\ 0 & f_y & c_y\\\\ 0 & 0 & 1 \\end{bmatrix}", 1],
          distcoeffs: ["(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \\tau_x, \\tau_y]]]]) \\text{ of 4, 5, 8, 12 or 14 elements}"],
          distcoeffsfisheye: ["(k_1, k_2, k_3, k_4)"],
          hdotsfor: ["\\dots", 1],
          mathbbm: ["\\mathbb{#1}", 1],
          bordermatrix: ["\\matrix{#1}", 1]
      }
  }
}
);
//]]>
</script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js" type="text/javascript"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css"/>
<link href="../../stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<!--#include virtual="/google-search.html"-->
<table cellpadding="0" cellspacing="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="../../opencv-logo-small.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">OpenCV
    <span id="projectnumber">4.5.2</span>
   </div>
   <div id="projectbrief">Open Source Computer Vision</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
<script src="../../menudata.js" type="text/javascript"></script>
<script src="../../menu.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
  initMenu('../../',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow" onkeydown="return searchBox.OnSearchSelectKey(event)" onmouseout="return searchBox.OnSearchSelectHide()" onmouseover="return searchBox.OnSearchSelectShow()">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe frameborder="0" id="MSearchResults" name="MSearchResults" src="javascript:void(0)">
</iframe>
</div>
<div class="navpath" id="nav-path">
  <ul>
<li class="navelem"><a class="el" href="../../d2/d75/namespacecv.html">cv</a></li><li class="navelem"><a class="el" href="../../db/d88/classcv_1_1BackgroundSubtractorKNN.html">BackgroundSubtractorKNN</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> |
<a href="../../d7/d1d/classcv_1_1BackgroundSubtractorKNN-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">cv::BackgroundSubtractorKNN Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span><div class="ingroups"><a class="el" href="../../d7/de9/group__video.html">Video Analysis</a> » <a class="el" href="../../de/de1/group__video__motion.html">Motion Analysis</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<p>K-nearest neighbours - based Background/Foreground Segmentation <a class="el" href="../../d3/d46/classcv_1_1Algorithm.html" title="This is a base class for all more or less complex algorithms in OpenCV. ">Algorithm</a>.  
 <a href="../../db/d88/classcv_1_1BackgroundSubtractorKNN.html#details">More...</a></p>
<p><code>#include &lt;opencv2/video/background_segm.hpp&gt;</code></p>
<div class="dynheader">
Inheritance diagram for cv::BackgroundSubtractorKNN:</div>
<div class="dyncontent">
 <div class="center">
  <img alt="" src="../../db/d88/classcv_1_1BackgroundSubtractorKNN.png" usemap="#cv::BackgroundSubtractorKNN_map"/>
  <map id="cv::BackgroundSubtractorKNN_map" name="cv::BackgroundSubtractorKNN_map">
<area alt="cv::BackgroundSubtractor" coords="0,56,185,80" href="../../d7/df6/classcv_1_1BackgroundSubtractor.html" shape="rect" title="Base class for background/foreground segmentation. : "/>
<area alt="cv::Algorithm" coords="0,0,185,24" href="../../d3/d46/classcv_1_1Algorithm.html" shape="rect" title="This is a base class for all more or less complex algorithms in OpenCV. "/>
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ae1efd8a9c7287f0b01ff024d3eaeff0a"><td align="right" class="memItemLeft" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d88/classcv_1_1BackgroundSubtractorKNN.html#ae1efd8a9c7287f0b01ff024d3eaeff0a">getDetectShadows</a> () const =0</td></tr>
<tr class="memdesc:ae1efd8a9c7287f0b01ff024d3eaeff0a"><td class="mdescLeft"> </td><td class="mdescRight">Returns the shadow detection flag.  <a href="#ae1efd8a9c7287f0b01ff024d3eaeff0a">More...</a><br/></td></tr>
<tr class="separator:ae1efd8a9c7287f0b01ff024d3eaeff0a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:acb609e83ae670195a9d4b7985d319def"><td align="right" class="memItemLeft" valign="top">virtual double </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d88/classcv_1_1BackgroundSubtractorKNN.html#acb609e83ae670195a9d4b7985d319def">getDist2Threshold</a> () const =0</td></tr>
<tr class="memdesc:acb609e83ae670195a9d4b7985d319def"><td class="mdescLeft"> </td><td class="mdescRight">Returns the threshold on the squared distance between the pixel and the sample.  <a href="#acb609e83ae670195a9d4b7985d319def">More...</a><br/></td></tr>
<tr class="separator:acb609e83ae670195a9d4b7985d319def"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:adca11897141bae5e5959ace3e6dd3896"><td align="right" class="memItemLeft" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d88/classcv_1_1BackgroundSubtractorKNN.html#adca11897141bae5e5959ace3e6dd3896">getHistory</a> () const =0</td></tr>
<tr class="memdesc:adca11897141bae5e5959ace3e6dd3896"><td class="mdescLeft"> </td><td class="mdescRight">Returns the number of last frames that affect the background model.  <a href="#adca11897141bae5e5959ace3e6dd3896">More...</a><br/></td></tr>
<tr class="separator:adca11897141bae5e5959ace3e6dd3896"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a90323a86c7d9a54f35ff37053d830107"><td align="right" class="memItemLeft" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d88/classcv_1_1BackgroundSubtractorKNN.html#a90323a86c7d9a54f35ff37053d830107">getkNNSamples</a> () const =0</td></tr>
<tr class="memdesc:a90323a86c7d9a54f35ff37053d830107"><td class="mdescLeft"> </td><td class="mdescRight">Returns the number of neighbours, the k in the kNN.  <a href="#a90323a86c7d9a54f35ff37053d830107">More...</a><br/></td></tr>
<tr class="separator:a90323a86c7d9a54f35ff37053d830107"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a26f9cb9cd9b8b6a7966b453bd69d3caf"><td align="right" class="memItemLeft" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d88/classcv_1_1BackgroundSubtractorKNN.html#a26f9cb9cd9b8b6a7966b453bd69d3caf">getNSamples</a> () const =0</td></tr>
<tr class="memdesc:a26f9cb9cd9b8b6a7966b453bd69d3caf"><td class="mdescLeft"> </td><td class="mdescRight">Returns the number of data samples in the background model.  <a href="#a26f9cb9cd9b8b6a7966b453bd69d3caf">More...</a><br/></td></tr>
<tr class="separator:a26f9cb9cd9b8b6a7966b453bd69d3caf"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9c72132fe895b12f71719f4edd3e02fa"><td align="right" class="memItemLeft" valign="top">virtual double </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d88/classcv_1_1BackgroundSubtractorKNN.html#a9c72132fe895b12f71719f4edd3e02fa">getShadowThreshold</a> () const =0</td></tr>
<tr class="memdesc:a9c72132fe895b12f71719f4edd3e02fa"><td class="mdescLeft"> </td><td class="mdescRight">Returns the shadow threshold.  <a href="#a9c72132fe895b12f71719f4edd3e02fa">More...</a><br/></td></tr>
<tr class="separator:a9c72132fe895b12f71719f4edd3e02fa"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a5a7271ec772d5eea1ebb97b1963cc7d1"><td align="right" class="memItemLeft" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d88/classcv_1_1BackgroundSubtractorKNN.html#a5a7271ec772d5eea1ebb97b1963cc7d1">getShadowValue</a> () const =0</td></tr>
<tr class="memdesc:a5a7271ec772d5eea1ebb97b1963cc7d1"><td class="mdescLeft"> </td><td class="mdescRight">Returns the shadow value.  <a href="#a5a7271ec772d5eea1ebb97b1963cc7d1">More...</a><br/></td></tr>
<tr class="separator:a5a7271ec772d5eea1ebb97b1963cc7d1"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7bc545ab1db20d1522b429cacbf4917d"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d88/classcv_1_1BackgroundSubtractorKNN.html#a7bc545ab1db20d1522b429cacbf4917d">setDetectShadows</a> (bool detectShadows)=0</td></tr>
<tr class="memdesc:a7bc545ab1db20d1522b429cacbf4917d"><td class="mdescLeft"> </td><td class="mdescRight">Enables or disables shadow detection.  <a href="#a7bc545ab1db20d1522b429cacbf4917d">More...</a><br/></td></tr>
<tr class="separator:a7bc545ab1db20d1522b429cacbf4917d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aae40ce724aa313259609606853b6956f"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d88/classcv_1_1BackgroundSubtractorKNN.html#aae40ce724aa313259609606853b6956f">setDist2Threshold</a> (double _dist2Threshold)=0</td></tr>
<tr class="memdesc:aae40ce724aa313259609606853b6956f"><td class="mdescLeft"> </td><td class="mdescRight">Sets the threshold on the squared distance.  <a href="#aae40ce724aa313259609606853b6956f">More...</a><br/></td></tr>
<tr class="separator:aae40ce724aa313259609606853b6956f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:adc3ce00b7ff6061ec0d255405aa1625f"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d88/classcv_1_1BackgroundSubtractorKNN.html#adc3ce00b7ff6061ec0d255405aa1625f">setHistory</a> (int history)=0</td></tr>
<tr class="memdesc:adc3ce00b7ff6061ec0d255405aa1625f"><td class="mdescLeft"> </td><td class="mdescRight">Sets the number of last frames that affect the background model.  <a href="#adc3ce00b7ff6061ec0d255405aa1625f">More...</a><br/></td></tr>
<tr class="separator:adc3ce00b7ff6061ec0d255405aa1625f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:acac38a02b7b32add859fbe78ef01b4ec"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d88/classcv_1_1BackgroundSubtractorKNN.html#acac38a02b7b32add859fbe78ef01b4ec">setkNNSamples</a> (int _nkNN)=0</td></tr>
<tr class="memdesc:acac38a02b7b32add859fbe78ef01b4ec"><td class="mdescLeft"> </td><td class="mdescRight">Sets the k in the kNN. How many nearest neighbours need to match.  <a href="#acac38a02b7b32add859fbe78ef01b4ec">More...</a><br/></td></tr>
<tr class="separator:acac38a02b7b32add859fbe78ef01b4ec"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aff347ac596a90bb3db2ceb91f19b5d87"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d88/classcv_1_1BackgroundSubtractorKNN.html#aff347ac596a90bb3db2ceb91f19b5d87">setNSamples</a> (int _nN)=0</td></tr>
<tr class="memdesc:aff347ac596a90bb3db2ceb91f19b5d87"><td class="mdescLeft"> </td><td class="mdescRight">Sets the number of data samples in the background model.  <a href="#aff347ac596a90bb3db2ceb91f19b5d87">More...</a><br/></td></tr>
<tr class="separator:aff347ac596a90bb3db2ceb91f19b5d87"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a85efc41f5e3e7f7ca2c92245829043c0"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d88/classcv_1_1BackgroundSubtractorKNN.html#a85efc41f5e3e7f7ca2c92245829043c0">setShadowThreshold</a> (double <a class="el" href="../../d7/d1b/group__imgproc__misc.html#gae8a4a146d1ca78c626a53577199e9c57">threshold</a>)=0</td></tr>
<tr class="memdesc:a85efc41f5e3e7f7ca2c92245829043c0"><td class="mdescLeft"> </td><td class="mdescRight">Sets the shadow threshold.  <a href="#a85efc41f5e3e7f7ca2c92245829043c0">More...</a><br/></td></tr>
<tr class="separator:a85efc41f5e3e7f7ca2c92245829043c0"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a5a4d993edba38be565198098bcc40004"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d88/classcv_1_1BackgroundSubtractorKNN.html#a5a4d993edba38be565198098bcc40004">setShadowValue</a> (int value)=0</td></tr>
<tr class="memdesc:a5a4d993edba38be565198098bcc40004"><td class="mdescLeft"> </td><td class="mdescRight">Sets the shadow value.  <a href="#a5a4d993edba38be565198098bcc40004">More...</a><br/></td></tr>
<tr class="separator:a5a4d993edba38be565198098bcc40004"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header pub_methods_classcv_1_1BackgroundSubtractor"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classcv_1_1BackgroundSubtractor')"><img alt="-" src="../../closed.png"/> Public Member Functions inherited from <a class="el" href="../../d7/df6/classcv_1_1BackgroundSubtractor.html">cv::BackgroundSubtractor</a></td></tr>
<tr class="memitem:aa735e76f7069b3fa9c3f32395f9ccd21 inherit pub_methods_classcv_1_1BackgroundSubtractor"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/df6/classcv_1_1BackgroundSubtractor.html#aa735e76f7069b3fa9c3f32395f9ccd21">apply</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> image, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> fgmask, double learningRate=-1)=0</td></tr>
<tr class="memdesc:aa735e76f7069b3fa9c3f32395f9ccd21 inherit pub_methods_classcv_1_1BackgroundSubtractor"><td class="mdescLeft"> </td><td class="mdescRight">Computes a foreground mask.  <a href="../../d7/df6/classcv_1_1BackgroundSubtractor.html#aa735e76f7069b3fa9c3f32395f9ccd21">More...</a><br/></td></tr>
<tr class="separator:aa735e76f7069b3fa9c3f32395f9ccd21 inherit pub_methods_classcv_1_1BackgroundSubtractor"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a98cb8e292a6cbcb32436dad62a82f974 inherit pub_methods_classcv_1_1BackgroundSubtractor"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/df6/classcv_1_1BackgroundSubtractor.html#a98cb8e292a6cbcb32436dad62a82f974">getBackgroundImage</a> (<a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> backgroundImage) const =0</td></tr>
<tr class="memdesc:a98cb8e292a6cbcb32436dad62a82f974 inherit pub_methods_classcv_1_1BackgroundSubtractor"><td class="mdescLeft"> </td><td class="mdescRight">Computes a background image.  <a href="../../d7/df6/classcv_1_1BackgroundSubtractor.html#a98cb8e292a6cbcb32436dad62a82f974">More...</a><br/></td></tr>
<tr class="separator:a98cb8e292a6cbcb32436dad62a82f974 inherit pub_methods_classcv_1_1BackgroundSubtractor"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header pub_methods_classcv_1_1Algorithm"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classcv_1_1Algorithm')"><img alt="-" src="../../closed.png"/> Public Member Functions inherited from <a class="el" href="../../d3/d46/classcv_1_1Algorithm.html">cv::Algorithm</a></td></tr>
<tr class="memitem:a827c8b2781ed17574805f373e6054ff1 inherit pub_methods_classcv_1_1Algorithm"><td align="right" class="memItemLeft" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#a827c8b2781ed17574805f373e6054ff1">Algorithm</a> ()</td></tr>
<tr class="separator:a827c8b2781ed17574805f373e6054ff1 inherit pub_methods_classcv_1_1Algorithm"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8ae826127fa0f1f8d10a24841bd376f8 inherit pub_methods_classcv_1_1Algorithm"><td align="right" class="memItemLeft" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#a8ae826127fa0f1f8d10a24841bd376f8">~Algorithm</a> ()</td></tr>
<tr class="separator:a8ae826127fa0f1f8d10a24841bd376f8 inherit pub_methods_classcv_1_1Algorithm"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aec9c965448e4dc851d7cacd3abd84cd1 inherit pub_methods_classcv_1_1Algorithm"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#aec9c965448e4dc851d7cacd3abd84cd1">clear</a> ()</td></tr>
<tr class="memdesc:aec9c965448e4dc851d7cacd3abd84cd1 inherit pub_methods_classcv_1_1Algorithm"><td class="mdescLeft"> </td><td class="mdescRight">Clears the algorithm state.  <a href="../../d3/d46/classcv_1_1Algorithm.html#aec9c965448e4dc851d7cacd3abd84cd1">More...</a><br/></td></tr>
<tr class="separator:aec9c965448e4dc851d7cacd3abd84cd1 inherit pub_methods_classcv_1_1Algorithm"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab6a18f1825475643e94381697d413972 inherit pub_methods_classcv_1_1Algorithm"><td align="right" class="memItemLeft" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#ab6a18f1825475643e94381697d413972">empty</a> () const</td></tr>
<tr class="memdesc:ab6a18f1825475643e94381697d413972 inherit pub_methods_classcv_1_1Algorithm"><td class="mdescLeft"> </td><td class="mdescRight">Returns true if the <a class="el" href="../../d3/d46/classcv_1_1Algorithm.html" title="This is a base class for all more or less complex algorithms in OpenCV. ">Algorithm</a> is empty (e.g. in the very beginning or after unsuccessful read.  <a href="../../d3/d46/classcv_1_1Algorithm.html#ab6a18f1825475643e94381697d413972">More...</a><br/></td></tr>
<tr class="separator:ab6a18f1825475643e94381697d413972 inherit pub_methods_classcv_1_1Algorithm"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a286fc82744ccab3d248aca44524266a9 inherit pub_methods_classcv_1_1Algorithm"><td align="right" class="memItemLeft" valign="top">virtual <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#a286fc82744ccab3d248aca44524266a9">getDefaultName</a> () const</td></tr>
<tr class="separator:a286fc82744ccab3d248aca44524266a9 inherit pub_methods_classcv_1_1Algorithm"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aef2ad3f4145bd6e8c3664eb1c4b5e1e6 inherit pub_methods_classcv_1_1Algorithm"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#aef2ad3f4145bd6e8c3664eb1c4b5e1e6">read</a> (const <a class="el" href="../../de/dd9/classcv_1_1FileNode.html">FileNode</a> &amp;fn)</td></tr>
<tr class="memdesc:aef2ad3f4145bd6e8c3664eb1c4b5e1e6 inherit pub_methods_classcv_1_1Algorithm"><td class="mdescLeft"> </td><td class="mdescRight">Reads algorithm parameters from a file storage.  <a href="../../d3/d46/classcv_1_1Algorithm.html#aef2ad3f4145bd6e8c3664eb1c4b5e1e6">More...</a><br/></td></tr>
<tr class="separator:aef2ad3f4145bd6e8c3664eb1c4b5e1e6 inherit pub_methods_classcv_1_1Algorithm"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0a880744bc4e3f45711444571df47d67 inherit pub_methods_classcv_1_1Algorithm"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#a0a880744bc4e3f45711444571df47d67">save</a> (const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp;filename) const</td></tr>
<tr class="separator:a0a880744bc4e3f45711444571df47d67 inherit pub_methods_classcv_1_1Algorithm"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1f8ad7b8add515077367fb9949a174d2 inherit pub_methods_classcv_1_1Algorithm"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#a1f8ad7b8add515077367fb9949a174d2">write</a> (<a class="el" href="../../da/d56/classcv_1_1FileStorage.html">FileStorage</a> &amp;fs) const</td></tr>
<tr class="memdesc:a1f8ad7b8add515077367fb9949a174d2 inherit pub_methods_classcv_1_1Algorithm"><td class="mdescLeft"> </td><td class="mdescRight">Stores algorithm parameters in a file storage.  <a href="../../d3/d46/classcv_1_1Algorithm.html#a1f8ad7b8add515077367fb9949a174d2">More...</a><br/></td></tr>
<tr class="separator:a1f8ad7b8add515077367fb9949a174d2 inherit pub_methods_classcv_1_1Algorithm"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a763a62d1b03042eef7d7fc3ac6c87c79 inherit pub_methods_classcv_1_1Algorithm"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#a763a62d1b03042eef7d7fc3ac6c87c79">write</a> (const <a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt; <a class="el" href="../../da/d56/classcv_1_1FileStorage.html">FileStorage</a> &gt; &amp;fs, const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp;name=<a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a>()) const</td></tr>
<tr class="memdesc:a763a62d1b03042eef7d7fc3ac6c87c79 inherit pub_methods_classcv_1_1Algorithm"><td class="mdescLeft"> </td><td class="mdescRight">simplified API for language bindings This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.  <a href="../../d3/d46/classcv_1_1Algorithm.html#a763a62d1b03042eef7d7fc3ac6c87c79">More...</a><br/></td></tr>
<tr class="separator:a763a62d1b03042eef7d7fc3ac6c87c79 inherit pub_methods_classcv_1_1Algorithm"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header pub_static_methods_classcv_1_1Algorithm"><td colspan="2" onclick="javascript:toggleInherit('pub_static_methods_classcv_1_1Algorithm')"><img alt="-" src="../../closed.png"/> Static Public Member Functions inherited from <a class="el" href="../../d3/d46/classcv_1_1Algorithm.html">cv::Algorithm</a></td></tr>
<tr class="memitem:a623841c33b58ea9c4847da04607e067b inherit pub_static_methods_classcv_1_1Algorithm"><td class="memTemplParams" colspan="2">template&lt;typename _Tp &gt; </td></tr>
<tr class="memitem:a623841c33b58ea9c4847da04607e067b inherit pub_static_methods_classcv_1_1Algorithm"><td align="right" class="memTemplItemLeft" valign="top">static <a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt; _Tp &gt; </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#a623841c33b58ea9c4847da04607e067b">load</a> (const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp;filename, const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp;objname=<a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a>())</td></tr>
<tr class="memdesc:a623841c33b58ea9c4847da04607e067b inherit pub_static_methods_classcv_1_1Algorithm"><td class="mdescLeft"> </td><td class="mdescRight">Loads algorithm from the file.  <a href="../../d3/d46/classcv_1_1Algorithm.html#a623841c33b58ea9c4847da04607e067b">More...</a><br/></td></tr>
<tr class="separator:a623841c33b58ea9c4847da04607e067b inherit pub_static_methods_classcv_1_1Algorithm"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3ba305a10d02479c13cf7d169c321547 inherit pub_static_methods_classcv_1_1Algorithm"><td class="memTemplParams" colspan="2">template&lt;typename _Tp &gt; </td></tr>
<tr class="memitem:a3ba305a10d02479c13cf7d169c321547 inherit pub_static_methods_classcv_1_1Algorithm"><td align="right" class="memTemplItemLeft" valign="top">static <a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt; _Tp &gt; </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#a3ba305a10d02479c13cf7d169c321547">loadFromString</a> (const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp;strModel, const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp;objname=<a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a>())</td></tr>
<tr class="memdesc:a3ba305a10d02479c13cf7d169c321547 inherit pub_static_methods_classcv_1_1Algorithm"><td class="mdescLeft"> </td><td class="mdescRight">Loads algorithm from a String.  <a href="../../d3/d46/classcv_1_1Algorithm.html#a3ba305a10d02479c13cf7d169c321547">More...</a><br/></td></tr>
<tr class="separator:a3ba305a10d02479c13cf7d169c321547 inherit pub_static_methods_classcv_1_1Algorithm"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad8c591bacb34c485f5b7a250c314fc53 inherit pub_static_methods_classcv_1_1Algorithm"><td class="memTemplParams" colspan="2">template&lt;typename _Tp &gt; </td></tr>
<tr class="memitem:ad8c591bacb34c485f5b7a250c314fc53 inherit pub_static_methods_classcv_1_1Algorithm"><td align="right" class="memTemplItemLeft" valign="top">static <a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt; _Tp &gt; </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#ad8c591bacb34c485f5b7a250c314fc53">read</a> (const <a class="el" href="../../de/dd9/classcv_1_1FileNode.html">FileNode</a> &amp;fn)</td></tr>
<tr class="memdesc:ad8c591bacb34c485f5b7a250c314fc53 inherit pub_static_methods_classcv_1_1Algorithm"><td class="mdescLeft"> </td><td class="mdescRight">Reads algorithm from the file node.  <a href="../../d3/d46/classcv_1_1Algorithm.html#ad8c591bacb34c485f5b7a250c314fc53">More...</a><br/></td></tr>
<tr class="separator:ad8c591bacb34c485f5b7a250c314fc53 inherit pub_static_methods_classcv_1_1Algorithm"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header pro_methods_classcv_1_1Algorithm"><td colspan="2" onclick="javascript:toggleInherit('pro_methods_classcv_1_1Algorithm')"><img alt="-" src="../../closed.png"/> Protected Member Functions inherited from <a class="el" href="../../d3/d46/classcv_1_1Algorithm.html">cv::Algorithm</a></td></tr>
<tr class="memitem:a68eeca71617474ad3d4561786f0289d2 inherit pro_methods_classcv_1_1Algorithm"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#a68eeca71617474ad3d4561786f0289d2">writeFormat</a> (<a class="el" href="../../da/d56/classcv_1_1FileStorage.html">FileStorage</a> &amp;fs) const</td></tr>
<tr class="separator:a68eeca71617474ad3d4561786f0289d2 inherit pro_methods_classcv_1_1Algorithm"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a id="details" name="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>K-nearest neighbours - based Background/Foreground Segmentation <a class="el" href="../../d3/d46/classcv_1_1Algorithm.html" title="This is a base class for all more or less complex algorithms in OpenCV. ">Algorithm</a>. </p>
<p>The class implements the K-nearest neighbours background subtraction described in <a class="el" href="../../d0/de3/citelist.html#CITEREF_Zivkovic2006">[298]</a> . Very efficient if number of foreground pixels is low. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="ae1efd8a9c7287f0b01ff024d3eaeff0a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae1efd8a9c7287f0b01ff024d3eaeff0a">◆ </a></span>getDetectShadows()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool cv::BackgroundSubtractorKNN::getDetectShadows </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.BackgroundSubtractorKNN.getDetectShadows(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Returns the shadow detection flag. </p>
<p>If true, the algorithm detects shadows and marks them. See createBackgroundSubtractorKNN for details. </p>
</div>
</div>
<a id="acb609e83ae670195a9d4b7985d319def"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acb609e83ae670195a9d4b7985d319def">◆ </a></span>getDist2Threshold()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual double cv::BackgroundSubtractorKNN::getDist2Threshold </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.BackgroundSubtractorKNN.getDist2Threshold(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Returns the threshold on the squared distance between the pixel and the sample. </p>
<p>The threshold on the squared distance between the pixel and the sample to decide whether a pixel is close to a data sample. </p>
</div>
</div>
<a id="adca11897141bae5e5959ace3e6dd3896"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adca11897141bae5e5959ace3e6dd3896">◆ </a></span>getHistory()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual int cv::BackgroundSubtractorKNN::getHistory </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.BackgroundSubtractorKNN.getHistory(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Returns the number of last frames that affect the background model. </p>
</div>
</div>
<a id="a90323a86c7d9a54f35ff37053d830107"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a90323a86c7d9a54f35ff37053d830107">◆ </a></span>getkNNSamples()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual int cv::BackgroundSubtractorKNN::getkNNSamples </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.BackgroundSubtractorKNN.getkNNSamples(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Returns the number of neighbours, the k in the kNN. </p>
<p>K is the number of samples that need to be within dist2Threshold in order to decide that that pixel is matching the kNN background model. </p>
</div>
</div>
<a id="a26f9cb9cd9b8b6a7966b453bd69d3caf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a26f9cb9cd9b8b6a7966b453bd69d3caf">◆ </a></span>getNSamples()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual int cv::BackgroundSubtractorKNN::getNSamples </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.BackgroundSubtractorKNN.getNSamples(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Returns the number of data samples in the background model. </p>
</div>
</div>
<a id="a9c72132fe895b12f71719f4edd3e02fa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9c72132fe895b12f71719f4edd3e02fa">◆ </a></span>getShadowThreshold()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual double cv::BackgroundSubtractorKNN::getShadowThreshold </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.BackgroundSubtractorKNN.getShadowThreshold(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Returns the shadow threshold. </p>
<p>A shadow is detected if pixel is a darker version of the background. The shadow threshold (Tau in the paper) is a threshold defining how much darker the shadow can be. Tau= 0.5 means that if a pixel is more than twice darker then it is not shadow. See Prati, Mikic, Trivedi and Cucchiara, Detecting Moving Shadows...*, IEEE PAMI,2003. </p>
</div>
</div>
<a id="a5a7271ec772d5eea1ebb97b1963cc7d1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5a7271ec772d5eea1ebb97b1963cc7d1">◆ </a></span>getShadowValue()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual int cv::BackgroundSubtractorKNN::getShadowValue </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.BackgroundSubtractorKNN.getShadowValue(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Returns the shadow value. </p>
<p>Shadow value is the value used to mark shadows in the foreground mask. Default value is 127. Value 0 in the mask always means background, 255 means foreground. </p>
</div>
</div>
<a id="a7bc545ab1db20d1522b429cacbf4917d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7bc545ab1db20d1522b429cacbf4917d">◆ </a></span>setDetectShadows()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void cv::BackgroundSubtractorKNN::setDetectShadows </td>
          <td>(</td>
          <td class="paramtype">bool </td>
          <td class="paramname"><em>detectShadows</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>None</td><td>=</td><td>cv.BackgroundSubtractorKNN.setDetectShadows(</td><td class="paramname">detectShadows</td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Enables or disables shadow detection. </p>
</div>
</div>
<a id="aae40ce724aa313259609606853b6956f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aae40ce724aa313259609606853b6956f">◆ </a></span>setDist2Threshold()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void cv::BackgroundSubtractorKNN::setDist2Threshold </td>
          <td>(</td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>_dist2Threshold</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>None</td><td>=</td><td>cv.BackgroundSubtractorKNN.setDist2Threshold(</td><td class="paramname">_dist2Threshold</td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Sets the threshold on the squared distance. </p>
</div>
</div>
<a id="adc3ce00b7ff6061ec0d255405aa1625f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adc3ce00b7ff6061ec0d255405aa1625f">◆ </a></span>setHistory()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void cv::BackgroundSubtractorKNN::setHistory </td>
          <td>(</td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>history</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>None</td><td>=</td><td>cv.BackgroundSubtractorKNN.setHistory(</td><td class="paramname">history</td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Sets the number of last frames that affect the background model. </p>
</div>
</div>
<a id="acac38a02b7b32add859fbe78ef01b4ec"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acac38a02b7b32add859fbe78ef01b4ec">◆ </a></span>setkNNSamples()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void cv::BackgroundSubtractorKNN::setkNNSamples </td>
          <td>(</td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>_nkNN</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>None</td><td>=</td><td>cv.BackgroundSubtractorKNN.setkNNSamples(</td><td class="paramname">_nkNN</td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Sets the k in the kNN. How many nearest neighbours need to match. </p>
</div>
</div>
<a id="aff347ac596a90bb3db2ceb91f19b5d87"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aff347ac596a90bb3db2ceb91f19b5d87">◆ </a></span>setNSamples()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void cv::BackgroundSubtractorKNN::setNSamples </td>
          <td>(</td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>_nN</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>None</td><td>=</td><td>cv.BackgroundSubtractorKNN.setNSamples(</td><td class="paramname">_nN</td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Sets the number of data samples in the background model. </p>
<p>The model needs to be reinitalized to reserve memory. </p>
</div>
</div>
<a id="a85efc41f5e3e7f7ca2c92245829043c0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a85efc41f5e3e7f7ca2c92245829043c0">◆ </a></span>setShadowThreshold()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void cv::BackgroundSubtractorKNN::setShadowThreshold </td>
          <td>(</td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>threshold</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>None</td><td>=</td><td>cv.BackgroundSubtractorKNN.setShadowThreshold(</td><td class="paramname">threshold</td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Sets the shadow threshold. </p>
</div>
</div>
<a id="a5a4d993edba38be565198098bcc40004"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5a4d993edba38be565198098bcc40004">◆ </a></span>setShadowValue()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void cv::BackgroundSubtractorKNN::setShadowValue </td>
          <td>(</td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>None</td><td>=</td><td>cv.BackgroundSubtractorKNN.setShadowValue(</td><td class="paramname">value</td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Sets the shadow value. </p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>opencv2/video/<a class="el" href="../../db/d73/background__segm_8hpp.html">background_segm.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.6-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Apr 2 2021 11:36:42 for OpenCV by  <a href="http://www.doxygen.org/index.html">
<img alt="doxygen" class="footer" src="../../doxygen.png"/>
</a> 1.8.13
</small></address>
<script type="text/javascript">
//<![CDATA[
addTutorialsButtons();
//]]>
</script>
</body>
</html>
